import { ICondition } from "../interface/ICondition";
import { BaseBehavior } from "./BaseBehavior";

export abstract class BaseCondition extends BaseBehavior implements ICondition {
    protected negation: boolean = false;

    public isNegation(): boolean {
        return this.negation;
    }

    public setNegation(negation: boolean): void {
        this.negation = negation;
    }

    public setConfig(config: any, target: any): void {
        this.config = config;
        this.target = target;
        if (this.config.params && this.config.params.negation) {
            this.setNegation(this.config.params.negation);
        }
    }

    protected getRandom(): number {
        let random = Math.random() * 100;
        return random;
    }
}
